<?php 
		session_start(); 
		include "function/libfunc.php";
 			if (!empty($_SESSION['username']) && !empty($_SESSION['password'])) { 
		  	$link="Kategori";
		  	include 'themes/head2.php';
			include 'themes/heading.php';
?>

                    <!-- Build page from here: -->
                    <script type="text/javascript">
                    $(function() {
$(".btn").click(function() {
var judul = $("#judul").val();
var deskripsi = $("#deskripsi").val();
var penulis = $("#penulis").val();
var keyword = $("#keyword").val();
var dataString = '&judul='+ judul + '&deskripsi=' + deskripsi+ '&penulis=' + penulis + '&keyword=' + keyword;

if(judul=='' || deskripsi=='' || penulis=='' || keyword=='')
{
$('.success').fadeOut(200).hide();
$('.error').fadeOut(200).show();
}
else
{
$.ajax({
type: "POST",
url: "function/procEditPeng.php",
data: dataString,
success: function(){
$('.success').fadeIn(200).show();
$('.error').fadeOut(200).hide();
}
});
}
return false;
});
});

function goBack()
  {
  window.history.back()
  }
  
                    
                    </script>
                   
                    <div class="row-fluid">

                        <div class="span9">

                            <div class="box">


                                <div class="title">

                                    <h4>
                                        <span class="icon16 icomoon-icon-equalizer-2"></span>
                                        <span><?php echo $link; ?> </span>
                                    </h4>
                                    
                                </div>
                                  <div class="content">
                                
                                   
                                    <form class="form-horizontal" action="function/procEditPeng.php" method="post">
                                    	 <?php  
									$link = koneksi_db();
									$sql  = "SELECT * FROM pengaturan";
									$res  = mysql_query($sql,$link);
									while( $data = mysql_fetch_array($res) ) {
 

										?>		  
                                        
                                        <div class="form-row row-fluid">
                                            <div class="span12">
                                                <div class="row-fluid" style="float:left">
                                                    <label class="form-label span4" for="normal"><?php echo $data['nama']; ?> </label>
                                                    <input id="<?php echo $data['nama']; ?>" name="<?php echo $data['nama']; ?>" 
                                                    value="<?php echo $data['isi'];  ?>" class="span8 tip" id="tooltipInput" type="text"  
                                                    title="Tuliskan <?php $data['nama']; ?>  Website Anda" required x-webkit-speech/> 
                                                </div>
                                            </div>
                                        </div>
                                        <?php
										}
										?>

                                        <div class="form-actions">
                                           <button type="submit" class="btn" class="submit">Simpan</button>
                                           <button type="button" class="btn" onclick="goBack()">Kembali</button><br />
                                           
                                           <span class="error" style="display:none; color:#FF0000 "> <b>Masih ada data yang kosong!</b></span>
											<span class="success" style="display:none; color:#0000FF"> <b>Pengaturan berhasil disimpan</b></span>
</div>
                                        </div>
                                                                                

                                    </form>
                                 
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span6 -->
                        <!-- End .span6 -->
                        <!-- End .span6 -->
                    </div>
                    <!-- End .row-fluid -->
                    <!-- End .row-fluid -->
                    <!-- End .row-fluid -->
                    <!-- End .row-fluid -->
<?php
include 'themes/footer.php';
}else {
echo "<script language='javascript'>window.location = '../admin/'</script>";
}
?>